package com.example.kdi;

import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.Fragment;
import android.support.v4.app.ListFragment;
import android.support.v4.app.NavUtils;
import android.text.Html;

public class ProduitListActivity extends FragmentActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.activity_produit_list);
		// Show the Up button in the action bar.
		getActionBar().setDisplayHomeAsUpEnabled(true);
	
//		if (savedInstanceState == null) {
//			// Create the detail fragment and add it to the activity
//			// using a fragment transaction.
//			Bundle arguments = new Bundle();
//			arguments.putString(ProduitListFragment.ARG_ITEM_ID, getIntent()
//					.getStringExtra(ProduitListFragment.ARG_ITEM_ID));
//			ProduitListFragment fragment = new ProduitListFragment();
//			fragment.setArguments(arguments);
//			getSupportFragmentManager().beginTransaction()
//					.add(R.id.produit_list_container, fragment).commit();
//		}
//		
	}

	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case android.R.id.home:
			// This ID represents the Home or Up button. In the case of this
			// activity, the Up button is shown. Use NavUtils to allow users
			// to navigate up one level in the application structure. For
			// more details, see the Navigation pattern on Android Design:
			//
			// http://developer.android.com/design/patterns/navigation.html#up-vs-back
			//
			this.finish();
			return true;
		
		}
		//return super.onOptionsItemSelected(item);
		return false;
	}

	public void changeActivity(View view) { 
	    startActivity(new Intent(this, KdiListActivity.class));
	}
	
	
	
	 
	

}
